home *** CD-ROM | disk | FTP | other *** search
- Path: antares.dfma.com!news
- From: johnb@dfma.com (John Breckenridge)
- Newsgroups: comp.lang.c
- Subject: Re: String Question
- Date: Mon, 18 Mar 1996 18:56:45 GMT
- Organization: Boothroyd Dewhurst, Inc.
- Message-ID: <4ijv0j$9na@antares.dfma.com>
- References: <DoBt0E.4A9@freenet.carleton.ca> <4ie983$3v0@sparcserver.lrz-muenchen.de>
- NNTP-Posting-Host: johnb.dfma.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- watzka@stat.uni-muenchen.de (Kurt Watzka) wrote:
-
- >aq436@FreeNet.Carleton.CA (Jerry Boyd) writes:
- >>How would I write a function to remove a specified
- >>number of characters from a string and store it in an array.
-
- >If you want to take part in the annual "reinvent the wheel" contest,
- >by copying a specified ...
-
- >Otherwise, use strncpy(), but don't forget to hav a look at the
- >documentation for that function from the standard C library
- >first.
-
- >>For instance, extracting three characters from a string, starting
- >>from the 5th character.
-
- > strncpy(dest, src + 5, 3);
- src + 5 is the 6th character!
- src + 4 would be the 5th character.
-
- John Breckenridge Boothroyd Dewhurst, Inc.
- johnb@dfma.com all opinions are my own
-
-